package com.ostrich.note.ui.note.repository;


import com.ostrich.note.entity.BaseResponseEntity;
import com.ostrich.note.net.RetrofitManager;
import com.ostrich.note.ui.note.NoteApi;
import com.ostrich.note.ui.note.entity.NoteEntity;
import com.ostrich.note.ui.note.entity.TypeEntity;

import java.util.List;

import androidx.lifecycle.LiveData;
import retrofit2.http.POST;
import retrofit2.http.Query;

public class NoteRepository  {
    private NoteApi mNoteApi;
    public NoteRepository() {
        mNoteApi = RetrofitManager.getInstance().getRetrofit().create(NoteApi.class);
    }

    public LiveData<BaseResponseEntity<List<NoteEntity>>> notepadDataList( int note_type_id){
        return mNoteApi.notepadDataList(note_type_id);
    }

    public LiveData<BaseResponseEntity<NoteEntity>> subclassDetailData(int note_type_id){
        return mNoteApi.subclassDetailData(note_type_id);
    }

    public LiveData<BaseResponseEntity<TypeEntity>> notepadClassifiedData(){
        return mNoteApi.notepadClassifiedData();
    }

    public LiveData<BaseResponseEntity> notepadClassDel(int type_id){
        return mNoteApi.notepadClassDel(type_id);
    }

    public LiveData<BaseResponseEntity> insertNotepadType(String title,int color){
        return mNoteApi.insertNotepadType(title,color);
    }




    public LiveData<BaseResponseEntity> notepadTitleEdit(String title,int color, int type_id){
        return mNoteApi.notepadTitleEdit(title,color,type_id);
    }


    public LiveData<BaseResponseEntity<List<NoteEntity>>> notepadSearchList( String keyword ){
        return mNoteApi.notepadSearchList(keyword);
    }


    public LiveData<BaseResponseEntity> notepadCollect(int note_type_id,int collect){
        return mNoteApi.notepadCollect(note_type_id,collect);
    }

    public LiveData<BaseResponseEntity> notepadSubclassDel(int note_type_id){
        return mNoteApi.notepadSubclassDel(note_type_id);
    }

    public LiveData<BaseResponseEntity> notepadDetailInsert(String thumb,String title ,long create_time, String content,int scrawl,int type_id){
        return mNoteApi.notepadDetailInsert(thumb, title, create_time, content, scrawl, type_id);
    }

    public LiveData<BaseResponseEntity> subclassDataEdit(String thumb,String title ,long create_time, String content,int scrawl,int type_id,int note_type_id){
        return mNoteApi.subclassDataEdit(thumb, title, create_time, content, scrawl, type_id,note_type_id);
    }

}
